print(
    '''
    *************************************
    *           中国工商银行              　*
    *           账户管理系统              　*
    *             V1.0                 　*
    *                                  　*
    *************************************
    *1.开户                              *
    *2.存钱                              *
    *3.取钱                              *
    *4.转账                              *
    *5.查询                              *
    *6.Bye！                             *
    **************************************
    '''
)
users = []
def add_user(account, name, password, money, bank, country, province, street, door):
    for user in users:
        if user['账号'] == account:
            print("账户已存在！")
            return 2
    if len(users) > 100:
        return 3
    user = {
        '账号': account,
        '姓名': name,
        '密码': password,
        '金额': money,
        '银行': bank,
        '国家': country,
        '省份': province,
        '街道': street,
        '门牌号': door,
    }
    users.append(user)

    return 1
def save_money(account, money):
    for user in users:
        if user['账号'] == account:
            user['金额'] += money
            print("存钱成功，当前金额:", user['金额'])
            return 0

    print("账户不存在！")
    return False
def get_money(account, password, money):
    for user in users:
        if user['账号'] == account:
            if user['密码'] == password:
                if user['金额'] >= money:
                    user['金额'] -= money
                    print("取钱成功，当前金额:", user['金额'])
                    return 0
                else:
                    print("取钱失败，余额不足，当前金额:", user['金额'])
                    return 3
            else:
                print("密码错误！")
                return 2

    print("账户不存在！")
    return 1
def remit(account1, account2, password, money):
    sender = None
    receiver = None
    for user in users:
        if user['账号'] == account1:
            sender = user
        if user['账号'] == account2:
            receiver = user
    if sender is not None and receiver is not None:
        if sender['密码'] == password:
            if sender['金额'] >= money:
                sender['金额'] -= money
                receiver['金额'] += money
                print("转账成功，当前金额:", sender['金额'])
                return 0
            else:
                print("转账失败，余额不足，当前金额:",sender['金额'])
                return 3
        else:
            print("密码错误！")
            return 2
    else:
        print("账户不存在！")
        return 1
def account_use(account, password):
    for user in users:
        if user['账号'] == account:
            if user['密码'] == password:
                print(f"当前账号:{account},"
                      f"密码:{password},"
                      f"余额:{user['金额']}元,"
                      f"用户居住地址:{user['国家']}{user['省份']}{user['街道']}{user['门牌号']},"
                      f"当前账户的开户行:{user['银行']}")
            else:
                print("密码错误")
            return
    print("该用户不存在")

add_user("12345678", "lilili", "123456", 2000, "中国工商银行", "中国", "山东", "凤凰", "1")
add_user("12345679", "lilili", "123456", 1000, "中国工商银行", "中国", "山东", "凤凰", "2")
print(users,end = "\n")
save_money("12345678", 1000)
get_money("12345678", "123456", 1000)
remit("12345678", "12345679", "123456", 1000)
account_use("12345678", "123456")